home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2002 November / CD 1 / APC0211D1.ISO / workshop / prog / files / ActivePerl-5.6.1.633-MSWin32.msi / _1b07dedceb1a3594554a257f825fdcfa < prev    next >
Encoding:
Text File  |  2001-08-23  |  772 b   |  38 lines

  1. #!perl
  2.  
  3. use strict;
  4. use warnings;
  5.  
  6. eval {
  7.     unless (Win32::IsWin95()) {
  8.     die "This only works on Windows 9x.\n";
  9.     }    
  10.     unless ($ENV{winbootdir}) {
  11.     die "No winbootdir environment variable.  Unable to continue.\n";
  12.     }
  13.  
  14.     my $autoexec = substr($ENV{winbootdir},0,2) .'\autoexec.bat';
  15.     my $perl = $^X;
  16.     $perl =~ s|\\.?perl.exe$||i;
  17.  
  18.     if ($perl =~ /\s/) {
  19.     $perl = "\"$perl\"";
  20.     }    
  21.  
  22.     if (-e $autoexec && ! -w $autoexec) {
  23.     chmod 0755, $autoexec
  24.         or die "Unable to make $autoexec writable: $!\n";
  25.     }
  26.  
  27.     open(F, ">>$autoexec") 
  28.     or die "Unable to open $autoexec for writing: $!\n";
  29.  
  30.     print F "\nSET PATH=$perl;%PATH%\n";
  31.     close F
  32.     or die "Error closing filehandle: $!\n";
  33.  
  34. };
  35.  
  36. warn $@ if $@;
  37.  
  38.